package com.lct.loop;

public class ForDemo4 {
    public static void main(String[] args) {
        //求三位数的水仙花数
        int count = 0;

        for (int i = 100; i < 1000 ; i++) {
            int ge = i % 10;
            int shi = i / 10 % 10;
            int bai = i /100 % 10;
            if (ge*ge*ge + shi*shi*shi + bai*bai*bai == i) {
                System.out.print(i + " ");
                count++;
            }
        }
        System.out.println();
        System.out.println(count);
    }
}
